package com.ueip.backend.controller;

import com.ueip.backend.service.UserInfoService;
import com.ueip.backend.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/user/info")
public class UserInfoController {
    @Autowired
    private UserInfoService userInfoService;

    @RequestMapping("/select/page")
    Result selectPage(@RequestBody Map<String, String> data) {
        return userInfoService.selectPage(data);
    }
    @RequestMapping("/get/length")
    Result getLength() {
        return userInfoService.getUserInfosLength();
    }
    @PostMapping("/delete/by/id")
    Result deleteById(@RequestBody Map<String, String> data) {
        return userInfoService.deleteById(data);
    }
    @PostMapping("/update")
    Result update(@RequestBody Map<String, String> data) {
        return userInfoService.update(data);
    }
    @PostMapping("/add")
    Result add(@RequestBody Map<String, String> data) {
        return userInfoService.add(data);
    }

    @PostMapping("/update/personal/info")
    Result updatePersonalInfo(@RequestBody Map<String, String> data) {
        return userInfoService.updatePersonalInfo(data);
    }
}
